<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
 * @author petra.barus
 */
class Dispatcher {

    public static function dispatch(Submission_Model $submission)
    {
        echo "Dispatching : Submission #".$submission->token.", Problem #".$submission->problem->token."\n";
        $problem = $submission->problem;
        $evaluator_script = $problem->get_evaluator_script();
        try {
            include $evaluator_script;
            $submission->save();
        }
        catch (Exception $ex)
        {
            echo $ex->getMessage();
        }
    }
}
//end of file